CXX = g++
CXXFLAGS = -Wall -Wextra -g
LIBS = 
TARGET = main
SOURCES = main.cpp server.cpp incoming_connection.cpp outgoing_connection.cpp file.cpp file_index.cpp util.cpp fragment.cpp
OBJECTS = $(SOURCES:%.cpp=%.o)

all: $(TARGET)

$(TARGET): $(OBJECTS)
	$(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)

-include .depend

.depend: $(SOURCES)
	$(CC) -MM $(SOURCES) > .depend

.PHONY: clean

clean:
	rm -f $(TARGET) $(OBJECTS) .depend
